Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace com.sun.activation dependencies to standardize on jakarta #9839

Closed

Conversation

ge0ffrey
Copy link
Contributor

@ge0ffrey ge0ffrey commented Jun 6, 2020

@ge0ffrey
Copy link
Contributor Author

ge0ffrey commented Jun 6, 2020

I would also have to removed the com.sun.activation dependency from the bom, but given that some projects (= resteasy for example) depend on it, that could disable transitive overrides that you might not want to loose. Fixing resteasy's transitive dependencies isn't in scope of this PR.

@ge0ffrey
Copy link
Contributor Author

ge0ffrey commented Jun 6, 2020

The plot thickens: javax.mail uses com.sun.*.LogSupport from the sun activation jar.

[ERROR] testInlineAttachmentLegacy  Time elapsed: 0.01 s  <<< ERROR!
java.lang.NoClassDefFoundError: com/sun/activation/registries/LogSupport
	at javax.activation.MailcapCommandMap.<init>(MailcapCommandMap.java:149)
	at javax.activation.CommandMap.getDefaultCommandMap(CommandMap.java:55)
	at javax.activation.DataHandler.getCommandMap(DataHandler.java:137)
	at javax.activation.DataHandler.getDataContentHandler(DataHandler.java:596)
	at javax.activation.DataHandler.getContent(DataHandler.java:524)
	at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1419)
	at io.quarkus.mailer.runtime.MailerImplTest.getContent(MailerImplTest.java:372)
	at io.quarkus.mailer.runtime.MailerImplTest.testInlineAttachmentLegacy(MailerImplTest.java:301)

@ge0ffrey
Copy link
Contributor Author

ge0ffrey commented Jun 6, 2020

Further research shows that activation-api doesn't contain the impl classes, but the com.sun artifact contains both impl and api classes. So given that:

  • both jars contain some of the same classes (=> cannot co-exist)
  • the jakarta.* jar doesn't contain the impl classes, so its not enough

the only logic conclusion is:

  • Only use com.sun.* , ban jakarta.activation:jakarta-activation-api

But that doesn't seem sensible...

@ge0ffrey
Copy link
Contributor Author

ge0ffrey commented Jun 6, 2020

Feel free to close this PR, as this approach doesn't seem to be fruitful (it creates failing tests). We need to look in another way to avoid the duplicate classes of activation in quarkus.

@gsmet
Copy link
Member

gsmet commented Jun 8, 2020

Only use com.sun.* , ban jakarta.activation:jakarta-activation-api

Yes, that's what we're supposed to do. I don't exactly know why they decided to encapsulate the API as it's a pain but that's how it is.

@gsmet gsmet closed this Jun 8, 2020
@gsmet gsmet added the triage/invalid This doesn't seem right label Jun 8, 2020
@ge0ffrey
Copy link
Contributor Author

ge0ffrey commented Jun 8, 2020

@gsmet javax.activation is banned, but jakarta.activation is not yet banned:
https://github.com/quarkusio/quarkus/blob/master/build-parent/pom.xml#L293

@gsmet
Copy link
Member

gsmet commented Jun 8, 2020

Yes so maybe we should do that. I don't think there is a clean implementation of Jakarta Activation not including also the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants